package com.netflix;

import com.netflix.api.TestService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ytj
 * @date 2021/12/16
 */
@RestController
public class ProviderController implements TestService {
    private Logger logger= LoggerFactory.getLogger(ProviderController.class);

    @Value("${server.port}")
    private String port;


    @Override
    public String test(String name) {
        try {
            Thread.sleep(100L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        logger.info("test方法被调用");
        return port+"-provider:"+name;
    }
}
